import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('component_data', { schema: 'db_lowcode' })
export class ComponentData {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: '组件数据ID' })
  id: number;

  @Column('int', { name: 'page_id', comment: '页面ID' })
  pageId: number;

  @Column('int', { name: 'account_id', comment: '账户ID' })
  accountId: number;

  @Column('text', { name: 'props', comment: '属性' })
  props: string;

  @Column('timestamp', {
    name: 'create_time',
    comment: '创建时间',
    default: () => 'CURRENT_TIMESTAMP',
  })
  createTime: Date;

  @Column('timestamp', {
    name: 'update_time',
    comment: '更新时间',
    default: () => 'CURRENT_TIMESTAMP',
  })
  updateTime: Date;
}
